import time

class VirtualMerchandise:
    """虚拟周边基类"""
    def __init__(self, name):
        self.name = name
        self.style = ""
        self.color = ""
        self.pattern = ""
    
    def customize(self):
        """定制周边的通用方法"""
        print(f"\n开始定制你的{self.name}...")
        
    def display(self):
        """展示定制结果"""
        print(f"\n===== 你的定制{self.name} =====")
        print(f"款式: {self.style}")
        print(f"颜色: {self.color}")
        print(f"图案: {self.pattern}")
        print("==========================")


class Tshirt(VirtualMerchandise):
    """T恤类"""
    def __init__(self):
        super().__init__("T恤")
        self.sleeve_type = ""
        
    def customize(self):
        super().customize()
        
        # 选择款式
        print("\n请选择T恤款式:")
        print("1. 圆领")
        print("2. V领")
        print("3. 连帽")
        choice = input("请输入选项(1-3): ")
        styles = ["圆领", "V领", "连帽"]
        self.style = styles[int(choice)-1] if choice in ["1", "2", "3"] else "圆领"
        
        # 选择袖型
        print("\n请选择袖型:")
        print("1. 短袖")
        print("2. 长袖")
        choice = input("请输入选项(1-2): ")
        self.sleeve_type = "短袖" if choice == "1" else "长袖"
        
        # 选择颜色
        print("\n请选择颜色:")
        print("1. 白色")
        print("2. 黑色")
        print("3. 蓝色")
        print("4. 红色")
        print("5. 绿色")
        choice = input("请输入选项(1-5): ")
        colors = ["白色", "黑色", "蓝色", "红色", "绿色"]
        self.color = colors[int(choice)-1] if choice in ["1", "2", "3", "4", "5"] else "白色"
        
        # 选择图案
        print("\n请选择图案:")
        print("1. 抽象艺术")
        print("2. 简约文字")
        print("3. 卡通形象")
        print("4. 自然风景")
        choice = input("请输入选项(1-4): ")
        patterns = ["抽象艺术", "简约文字", "卡通形象", "自然风景"]
        self.pattern = patterns[int(choice)-1] if choice in ["1", "2", "3", "4"] else "抽象艺术"
    
    def display(self):
        super().display()
        print(f"袖型: {self.sleeve_type}")


class Mug(VirtualMerchandise):
    """马克杯类"""
    def __init__(self):
        super().__init__("马克杯")
        self.size = ""
        
    def customize(self):
        super().customize()
        
        # 选择款式
        print("\n请选择马克杯款式:")
        print("1. 经典款")
        print("2. 带盖款")
        print("3. 带把手款")
        choice = input("请输入选项(1-3): ")
        styles = ["经典款", "带盖款", "带把手款"]
        self.style = styles[int(choice)-1] if choice in ["1", "2", "3"] else "经典款"
        
        # 选择尺寸
        print("\n请选择尺寸:")
        print("1. 小 (300ml)")
        print("2. 中 (450ml)")
        print("3. 大 (600ml)")
        choice = input("请输入选项(1-3): ")
        sizes = ["小 (300ml)", "中 (450ml)", "大 (600ml)"]
        self.size = sizes[int(choice)-1] if choice in ["1", "2", "3"] else "中 (450ml)"
        
        # 选择颜色
        print("\n请选择颜色:")
        print("1. 白色")
        print("2. 黑色")
        print("3. 粉色")
        print("4. 蓝色")
        choice = input("请输入选项(1-4): ")
        colors = ["白色", "黑色", "粉色", "蓝色"]
        self.color = colors[int(choice)-1] if choice in ["1", "2", "3", "4"] else "白色"
        
        # 选择图案
        print("\n请选择图案:")
        print("1. 咖啡元素")
        print("2. 励志语录")
        print("3. 简约几何")
        print("4. 动物形象")
        choice = input("请输入选项(1-4): ")
        patterns = ["咖啡元素", "励志语录", "简约几何", "动物形象"]
        self.pattern = patterns[int(choice)-1] if choice in ["1", "2", "3", "4"] else "简约几何"
    
    def display(self):
        super().display()
        print(f"尺寸: {self.size}")


class Sticker(VirtualMerchandise):
    """贴纸类"""
    def __init__(self):
        super().__init__("贴纸")
        self.size = ""
        self.quantity = ""
        
    def customize(self):
        super().customize()
        
        # 选择款式
        print("\n请选择贴纸款式:")
        print("1. 哑光")
        print("2. 亮面")
        print("3. 全息")
        choice = input("请输入选项(1-3): ")
        styles = ["哑光", "亮面", "全息"]
        self.style = styles[int(choice)-1] if choice in ["1", "2", "3"] else "亮面"
        
        # 选择尺寸
        print("\n请选择尺寸:")
        print("1. 小 (5cm x 5cm)")
        print("2. 中 (10cm x 10cm)")
        print("3. 大 (15cm x 15cm)")
        choice = input("请输入选项(1-3): ")
        sizes = ["小 (5cm x 5cm)", "中 (10cm x 10cm)", "大 (15cm x 15cm)"]
        self.size = sizes[int(choice)-1] if choice in ["1", "2", "3"] else "中 (10cm x 10cm)"
        
        # 选择颜色
        print("\n请选择主色调:")
        print("1. 多彩")
        print("2. 黑白")
        print("3. 单色系")
        choice = input("请输入选项(1-3): ")
        colors = ["多彩", "黑白", "单色系"]
        self.color = colors[int(choice)-1] if choice in ["1", "2", "3"] else "多彩"
        
        # 选择图案
        print("\n请选择图案:")
        print("1. 趣味表情包")
        print("2. 复古图案")
        print("3. 科幻元素")
        print("4. 手绘风格")
        choice = input("请输入选项(1-4): ")
        patterns = ["趣味表情包", "复古图案", "科幻元素", "手绘风格"]
        self.pattern = patterns[int(choice)-1] if choice in ["1", "2", "3", "4"] else "趣味表情包"
        
        # 选择数量
        print("\n请选择数量:")
        print("1. 3个装")
        print("2. 5个装")
        print("3. 10个装")
        choice = input("请输入选项(1-3): ")
        quantities = ["3个装", "5个装", "10个装"]
        self.quantity = quantities[int(choice)-1] if choice in ["1", "2", "3"] else "5个装"
    
    def display(self):
        super().display()
        print(f"尺寸: {self.size}")
        print(f"数量: {self.quantity}")


def main():
    print("===== 虚拟周边定制工坊 =====")
    print("欢迎来到虚拟周边定制工坊！在这里，你可以设计属于自己的独特周边。")
    
    while True:
        # 选择周边类型
        print("\n请选择你想要定制的周边类型:")
        print("1. T恤")
        print("2. 马克杯")
        print("3. 贴纸")
        print("4. 退出程序")
        
        choice = input("请输入选项(1-4): ")
        
        if choice == "4":
            print("\n感谢使用虚拟周边定制工坊！再见！")
            break
        
        # 创建对应类型的周边对象
        merch = None
        if choice == "1":
            merch = Tshirt()
        elif choice == "2":
            merch = Mug()
        elif choice == "3":
            merch = Sticker()
        else:
            print("无效的选项，请重新选择。")
            continue
        
        # 定制周边
        merch.customize()
        
        # 展示定制结果
        print("\n正在生成你的定制周边...")
        time.sleep(1)  # 模拟生成过程
        merch.display()
        
        # 询问是否继续定制
        again = input("\n是否要继续定制其他周边？(y/n): ").lower()
        if again != "y":
            print("\n感谢使用虚拟周边定制工坊！你的定制已保存。再见！")
            break


if __name__ == "__main__":
    main()
